<?php

  /*

      TravianWAP
      Copyright (c) 2007-08 by Ananas - All rights reserved
      http://n00bz.biz/travianwap/
      Contact: uroskn@gmail.com

      --------------------------------------------------------------------------

      This program is free software: you can redistribute it and/or modify
      it under the terms of the GNU  General Public License as published by
      the Free Software Foundation, either version 3 of the License, or
      (at your option) any later version.

      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.

      You should have received a copy of the GNU  General Public License
      along with this program. If not, see http://www.gnu.org/licenses/.

  */

  define("MODULE_OK", 1);
  if (!defined("MAIN_UNIT")) die("h4xx0r");
  global $txt;
  
  $_SESSION["village"] = travian_extract_village_name($txt, True);
  printtop($txt);

  $vill = travian_return_buildings_in_village($_SESSION);
  for ($i = 0; $i < 22; $i++)
  {
    print_link("main.php?mod=construct&amp;".$vill["buildings"][$i]["link"].ps(), $vill["buildings"][$i]["name"], "<br/>");
  }
  
  if (!empty($vill["construction"][0]["title"]))
  {
    echo "<br/>";
    for ($i = 0; $i <= 2; $i++)
    {
      if (!empty($vill["construction"][$i]["title"]))
      {
        print_link("main.php?mod=direct_call&amp;file=dorf1&amp;".htmlspecialchars($vill["construction"][$i]["url"])."&amp;return=main".ps(), "[X]", " ");
        echo $vill["construction"][$i]["title"]."<br/>".pdate($vill["construction"][$i]["end"]).
             " - ".pdate($vill["construction"][$i]["endat"], False)."<br/>";
      }
    }
  }

  echo "<br/>";
 // print_link("main.php?mod=main".ps(), "Resource overview", "<br/>");
